#ifndef HDCDOMEVIDEOPANEL_H
#define HDCDOMEVIDEOPANEL_H
#include <QtWidgets>
#include "../HCustomWidgets/HComponent.h"
class HDCDomeVideoPanel : public HBorderTwinklingWidget
{
    Q_OBJECT
public:
    HDCDomeVideoPanel(QWidget *parent = 0);
    ~HDCDomeVideoPanel();

    void                      setVideoPixmap(QPixmap pixmap);
    HWND                      getVideoHWnd();
    QWidget                   *getVideoWidget();
    void                      updateDisplay();
    void                      setChecked(bool bChecked);
	void                      showBottomBar(bool bShow);
    void                      setResolutionVisible(bool bVisible);
	void                      setData(QVariant varData);
	QVariant                  getData();
	void                      setVideoName(QString strVideoName);
	QString                   getVideoName();
	void                      setResolution(QString strResolution);
	QString                   getResolution();
	void                      setBitSteamChecked(int nBitSteam);
	int                       getBitSteam();
	void                      setVideoPlay(bool bPlay);
	void                      setBroadCastEnable(bool bEnable);
    void                      setBroadCastChecked(bool bChecked);
	void                      setVideoSelectEnable(bool bEnable);
	//void                      setBitSteamBtnVisible(int nBitStream,bool bVisible);
    void                      setWarningState(bool bWarning);
    void                      setHasHistoryWarning(bool bHasHistoryWarning);
	bool                      isVideoPlaying();
	bool                      isVideoPanelChecked();
	QString                   getDeviceIDFromVideoPanel(HDCDomeVideoPanel *wndVideoPanel);
	void                      copyVideoPanelValue(HDCDomeVideoPanel *pwndVideoPanel);

protected:
   // void                      paintEvent(QPaintEvent *event);
    void                      resizeEvent(QResizeEvent *event);
    void                      mousePressEvent(QMouseEvent *event);
    void                      mouseReleaseEvent(QMouseEvent *event);
	void                      mouseDoubleClickEvent(QMouseEvent *event);

private:
    void                      initUI();

private slots:
    void                      sltBroadCaseBtnClicked();
    void                      sltWarningBtnClicked();
    void                      sltBitStreamBtnClicked(int nBitStreamIndex);
	void                      sltHideBottom();
	void                      sltCloseCurrentVideo();

private:
    QVBoxLayout               *m_pvblMain;
    QHBoxLayout               *m_phblTitle;
    QHBoxLayout               *m_phblBottom;

    QWidget                   *m_pwndTitle;
    QLabel                    *m_plblVideoName;
    QLabel                    *m_plblVideoResolution;
    QPushButton               *m_ppbMainBitStream;
    QPushButton               *m_ppbSubBitStream;
    QButtonGroup              *m_pbgBitStream;

    QLabel                    *m_plblVideo;

    QWidget                   *m_pwndBottom;
    QPushButton               *m_ppbHangingUp;
    QPushButton               *m_ppbBroadCast;
    QPushButton               *m_ppbWarning;

    bool                      m_bChecked;
    QPoint                    m_posPressed;

	QVariant                  m_varData;

    int                       m_nCurrentBitStreamIndex;

	QTimer                    *m_pBottomHideTimer;

	bool                      m_bVideoPlaying;

	bool                      m_bVideoSelectEnable;

    bool                      m_bHasWarning;
    bool                      m_bHasNewWarning;

signals:
    void                      sigPanelChecked();
    //void                      sigCloseCurrentVideo();
    void                      sigCloseCurrentBroadCast();
    void                      sigOpenCurrentVideoBroadCast();
    void                      sigViewWarningInfo();
    void                      sigBitStreamChanged(int nstreamType);
	void                      sigPanelDoubleClicked();
	void                      sigVideoWarningStateChanged(QHash<QString,QVariant> hashData,bool bWarning);
	void                      sigCloseVideo(HDCDomeVideoPanel*);
//	void                      sigVideoPanelChanged(HDCDomeVideoPanel*);
};

#endif
